home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD ROM Paradise Collection 4
/
CD ROM Paradise Collection 4 1995 Nov.iso
/
program
/
swagg_m.zip
/
GRAPHICS.SWG
/
0148_Azimuth line.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1995-03-03
|
793b
|
27 lines
{
This procedure will draw a line from an origin point for a
specified length at a specified angle using the current linestyle.
Must be in graphics mode.
}
Procedure Azimuth(OrigX,OrigY,Length:integer;Angle:real);
{ OrigX and OrigY - starting point coordinates }
{ Length - length of the line }
{ Angle - self explainatory }
var A,B:real;
begin
Angle:=(Angle*pi)/180.0; { convert angle in degrees to radians }
moveto(OrigX,OrigY); { move to the starting point }
A:=Length*sin(Angle); { get there from here }
B:=Length*cos(Angle);
linerel(round(B),round(A)); { draw line to calculated endpoint }
end;